<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<!--[if lt IE 9]>
<script type="text/javascript" src="/static/v5//lib/html5shiv.js"></script>
<script type="text/javascript" src="/static/v5//lib/respond.min.js"></script>

<![endif]-->
<link rel="stylesheet" type="text/css" href="/static/v5//static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/v5//static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/v5//lib/Hui-iconfont/1.0.8/iconfont.css" />

<link rel="stylesheet" type="text/css" href="/static/v5//static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/static/v5//static/h-ui.admin/css/style.css" />

</head>
<body>
<div class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-article-add">


		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">作品内容：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<div id="editor">

				</div>
			</div>
		</div>

	</form>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/static/v5//lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/v5//lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/v5//static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/v5//static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
<!-- 注意， 只需要引用 JS，无需引用任何 CSS ！！！-->
<script type="text/javascript" src="/static/v5//js/wangEditor.min.js"></script>
<script type="text/javascript" src="/static/v5/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" th:inline="javascript">
    var works_content  = [[${detail.works_content}]];

    var E = window.wangEditor
    var editor = new E('#editor')
    // 关闭粘贴内容中的样式
    editor.customConfig.pasteFilterStyle = false
    // 忽略粘贴内容中的图片
    editor.customConfig.pasteIgnoreImg = true
    // 使用 base64 保存图片
    //editor.customConfig.uploadImgShowBase64 = true

    // 上传图片到服务器
    editor.customConfig.uploadFileName = 'frontFile'; //设置文件上传的参数名称

    editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024; // 将图片大小限制为 3M
    //自定义上传图片事件
    editor.customConfig.uploadImgHooks = {
        before : function(xhr, editor, files) {

        },
        success : function(xhr, editor, result) {
            console.log("上传成功");
        },
        fail : function(xhr, editor, result) {
            console.log("上传失败,原因是"+result);
        },
        error : function(xhr, editor) {
            console.log("上传出错");
        },
        timeout : function(xhr, editor) {
            console.log("上传超时");
        }
    }

    editor.create()
    editor.txt.html(works_content)

</script>
</body>
</html>